import java.util.ArrayList;
import java.util.List;

/**
 * 1832. 判断句子是否为全字母句
 * https://leetcode-cn.com/problems/check-if-the-sentence-is-pangram/
 */
public class Solutions_1832 {
    public static void main(String[] args) {
        String sentence1 = "thequickbrownfoxjumpsoverthelazydog";  // output: true
        String sentence2 = "leetcode";  // output: false

        List<String> inputs = new ArrayList<>();
        inputs.add(sentence1);
        inputs.add(sentence2);

        for (String input : inputs) {
            boolean result = checkIfPangram(input);
            System.out.println(result);
        }
    }

    public static boolean checkIfPangram(String sentence) {
        if (sentence == null || sentence.length() < 26) {
            return false;
        }
        boolean[] map = new boolean[26];
        char[] arr = sentence.toCharArray();
        for (char c : arr) {
            map[c - 'a'] = true;
        }
        for (boolean flag : map) {
            if (!flag) {
                return false;
            }
        }
        return true;
    }
}
